Skip to content

Conversation

@automationai
Copy link

get the default timezone via CalendarApp to fix the issue
change the 1st param of formatDate() from 'message' to 'date' unlock the limitation

get the default timezone via CalendarApp to fix the issue
change the 1st param of formatDate() from 'message' to 'date' unlock the limitation
* @return {string} Formatted date
*/
function formatDate(message, format, timezone) {
function formatDate(date, format, timezone) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from 'message' to 'date' to unlock the limitation

function localTimezone_() {
var timezone = new Date().toTimeString().match(/\(([a-z0-9]+)\)/i);
return timezone.length ? timezone[1] : 'GMT';
var timezone = CalendarApp.getDefaultCalendar().getTimeZone();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CalendarApp to get default timezone to fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant